//
//  KLAccountCell.m
//  KLShoppingList
//
//  Created by apple on 2017/8/19.
//  Copyright © 2017年 NetEaseExam. All rights reserved.
//

#import "KLAccountCell.h"

#import "KLHouseModel.h"

#import "KLConfig.h"

@interface KLAccountCell ()
@property (weak, nonatomic) IBOutlet UILabel *housePriceLabel;
@property (weak, nonatomic) IBOutlet UILabel *houseTaxLabel;
@property (weak, nonatomic) IBOutlet UILabel *houseBenefitLabel;

@end

@implementation KLAccountCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    KLAccountCell *footer = [tableView dequeueReusableCellWithIdentifier:account_reuse_id];
    if (footer == nil) {
        footer = [[[NSBundle mainBundle] loadNibNamed:@"KLAccountCell" owner:nil options:nil] firstObject];
    }
    return footer;
}

- (void)setHouseModel:(KLHouseModel *)houseModel{
    _houseModel = houseModel;
    self.housePriceLabel.text = [NSString stringWithFormat:@"￥%.2f",houseModel.housePrice];
    self.houseTaxLabel.text = [NSString stringWithFormat:@"￥%.2f",houseModel.houseTax];
    self.houseBenefitLabel.text = [NSString stringWithFormat:@"-￥%.2f",houseModel.houseBenefit];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    UIView *bottomBorder = [[UIView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height-0.5, self.bounds.size.width*1.5, 0.5)];
    bottomBorder.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:bottomBorder];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
